package version1.part2.common.message;

import lombok.Builder;
import lombok.Data;

import java.io.Serializable;

/**
 * @author Stone
 * @version 1.0.1
 * @date 2025/9/16
 */
@Data
@Builder
public class RpcResponse implements Serializable {
    private int code;
    private String msg;
    private Object data;//具体数据
    //成功信息
    public static RpcResponse susses(Object data){
        return RpcResponse.builder().code(200).data(data).build();
    }

    public static RpcResponse fail(){
        return RpcResponse.builder().code(500).msg("服务器发生错误").build();
    }
}
